package com.zer0.tga.entity.livingentity.flyingentity;

import com.zer0.tga.art.ArtArchive;
import com.zer0.tga.art.Bitmap;
import com.zer0.tga.entity.Entity;
import com.zer0.tga.entity.abstractentity.AbstractEntity;
import com.zer0.tga.entity.livingentity.LivingEntity;
import com.zer0.tga.entity.livingentity.mob.Mob;
import com.zer0.tga.level.Level;
import com.zer0.tga.math.Coordinate;
import com.zer0.tga.math.Direction;

public class TeemoDart extends Bullet {

	public TeemoDart(Coordinate position, Coordinate radius, Coordinate target, Level level) {
		super(position, radius, target, level);

		
		//passable = true;
	}
	
	@Override
	public Bitmap getArt() {
		// TODO Auto-generated method stub
		
		return ArtArchive.bullet[0][direction];
		
		
	}
	
	public boolean collision(Entity entity, Direction dir) 
    {
	//	System.out.println("bullet " + entity.getClass().getSimpleName());
		   
	/*	if(entity == null)
		{
			this.removed = true;
			//hurt(1);
		}*/
		if(entity instanceof Mob)
		{
			//System.out.println("Bullet hit!");
			((LivingEntity)entity).hurt(damage);

			//this.damage = 0;
		//	this.removed = true;
		}
		else if(entity instanceof Bullet || entity instanceof AbstractEntity)
		{
			return true;
		}
			this.removed = true;
			return false;
	 //	entity.hurt(this);
    //	this.removed = true;
    }

	@Override
	public void init() {
		// TODO Auto-generated method stub
		movementSpeed = 5.0;
		maxLivingTime = 50;
		unitType = UnitType.FRIENDLY;
		health = maxHealth = 1;
	    damage = 1;
	}

}
